;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages erlang-xyz)
  #:use-module (guix build-system rebar)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages erlang)
  #:use-module (gnu packages python)
  #:use-module ((guixrus licenses) #:prefix license:)
  #:use-module ((guixrus packages idna) #:prefix rus:))

(define-public erlang-erl-conc
  (let ((commit "e1742c64aa5ab1f1a62827be800c9e4dc7af3661")
        (revision "0"))
    (package
      (name "erlang-erl-conc")
      (version "0.1.4")
      (source
       (origin
         (method git-fetch)
         (uri
          (git-reference
           (url "https://github.com/dustin/erl-conc")
           (commit commit)))
         (file-name (git-file-name name commit))
         (sha256
          (base32 "0ixh5fydbv0i94an6bjc9iwlibcqnbhjyk4kfl2adbr29h8pk1s0"))))
      (build-system rebar-build-system)
      (home-page "https://github.com/dustin/erl-conc/")
      (synopsis "Concurrent Lists in Erlang")
      (description
  "@code{erlang-erl-conc} is an erlang conc list implementation.")
      (license license:expat))))

(define-public erlang-sql-migrations
  (let ((commit "0210d023bfadcbfb25f3bb401207b98fb286720e")
        (revision "0"))
    (package
      (name "erlang-sql-migrations")
      (version "0.1.4")
      (source
       (origin
         (method git-fetch)
         (uri
          (git-reference
           (url "https://github.com/spawngrid/erlang-sql-migrations")
           (commit commit)))
         (file-name (git-file-name name commit))
         (sha256
          (base32 "0v7plriwsq5nm368cb2sb1dqxxxzhl99zvy64fp3s8c83mdhklc0"))))
    (build-system rebar-build-system)
    (arguments
      '(#:tests? #f)) ; no tests
      (home-page "https://github.com/spawngrid/erlang-sql-migrations/")
      (synopsis "Simple Erlang library to run SQL migrations")
      (description
  "@code{erlang-sql-migrations} is an erlang conc list implementation.")
      (license license:none)))) ; no license

(define-public erlang-cowlib
  (package
    (name "erlang-cowlib")
    (version "2.11.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "cowlib" version))
              (sha256
               (base32
                "1ac6pj3x4vdbsa8hvmbzpdfc4k0v1p102jbd39snai8wnah9sgib"))))
    (build-system rebar-build-system)
    (arguments
      '(#:tests? #f)) ; ===> Compiling src/cow_date.erl failed
    (synopsis "Support library for manipulating Web protocols.")
    (description "Support library for manipulating Web protocols.")
    (home-page "https://hex.pm/packages/cowlib")
    (license license:isc)))

(define-public erlang-qsp
  (package
    (name "erlang-qsp")
    (version "0.1.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "qsp" version))
              (sha256
               (base32
                "0pbniwcghwgxdfq2syihxflbp53bnigvd4da2wmnh78h6p6r2mfw"))))
    (build-system rebar-build-system)
    (inputs (list erlang-cowlib))
    (synopsis "Enhanced query string parser")
    (description "Enhanced query string parser")
    (home-page "https://hexdocs.pm/qsp/")
    (license license:expat)))

(define-public erlang-pc
  (package
    (name "erlang-pc")
    (version "1.14.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "pc" version))
              (sha256
               (base32
                "0lrmk905xnvjfsjjmycvhkkrvq1b4slgmvmswqalcwdgar9pwngw"))))
    (build-system rebar-build-system)
    (synopsis "a rebar3 port compiler for native code")
    (description "a rebar3 port compiler for native code")
    (home-page "https://hex.pm/packages/pc")
    (license license:expat)))

(define-public erlang-eql
  (package
    (name "erlang-eql")
    (version "0.2.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "eql" version))
              (sha256
               (base32
                "07gm7c53s8qys9xby36lmbawwrmvg8jmqixpna984vp8dsrycfsi"))))
    (build-system rebar-build-system)
    (synopsis "Erlang with SQL")
    (description "Erlang with SQL")
    (home-page "https://hex.pm/packages/eql")
    (license license:expat)))

(define-public erlang-goldrush
  (package
    (name "erlang-goldrush")
    (version "0.1.9")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "goldrush" version))
              (sha256
               (base32
                "1ssck5yr7rnrfwzm55pbyi1scgs1sl1xim75h5sj5czwrwl43jwr"))))
    (build-system rebar-build-system)
    (synopsis "Erlang event stream processor")
    (description "Erlang event stream processor")
    (home-page "https://hex.pm/packages/goldrush")
    (license license:isc)))

(define-public erlang-lager
  (package
    (name "erlang-lager")
    (version "3.9.2")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "lager" version))
              (sha256
               (base32
                "0a0c6kvc2jman62vrx2l3nx6xqn8s5l1glvf2mk7xjx8hyg4v43z"))))
    (build-system rebar-build-system)
    (arguments
      '(#:tests? #f)) ; One or more tests were cancelled.
    (inputs (list erlang-goldrush))
    (synopsis "Erlang logging framework")
    (description "Erlang logging framework")
    (home-page "https://hexdocs.pm/lager/")
    (license license:asl2.0)))

(define-public erlang-gun
  (package
    (name "erlang-gun")
    (version "1.3.3")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "gun" version))
              (sha256
               (base32
                "1q21j1s6w9cbh8f3l95fjqwlx0ad9bm59yz497w275wwgwbcw1ii"))))
    (build-system rebar-build-system)
    (inputs (list erlang-cowlib))
    (synopsis "HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP.")
    (description "HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP.")
    (home-page "https://hexdocs.pm/gun/")
    (license license:isc)))

(define-public erlang-shotgun
  (package
    (name "erlang-shotgun")
    (version "0.5.3")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "shotgun" version))
              (sha256
               (base32
                "1xi7wg974hs7kinnf04g0wjcb674wnqzy1sssx2vpb638zir6fjv"))))
    (build-system rebar-build-system)
    (arguments
 ;; ===> Failed to fetch and copy dep:
 ;; {git,"https://github.com/ninenines/cowboy.git", {tag,"2.4.0"}}
      '(#:tests? #f))
    (inputs (list erlang-gun))
    (synopsis "better than just a gun")
    (description "better than just a gun")
    (home-page "https://hexdocs.pm/shotgun/")
    (license license:asl2.0)))

(define-public erlang-metrics
  (package
    (name "erlang-metrics")
    (version "2.5.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "metrics" version))
              (sha256
               (base32
                "0jviygsq88x6hymrhrg1zwg1wp71ccmpk6my2xyykgf3r0w1j1mf"))))
    (build-system rebar-build-system)
    (arguments
 ;; ===> Could not write to "/homeless-shelter/.cache/rebar3/hex". Please
 ;; ensure the path is writeable.
      '(#:tests? #f))
    (synopsis "A generic interface to different metrics systems in Erlang.")
    (description
     "This package provides a generic interface to different metrics systems in
Erlang.")
    (home-page "https://hex.pm/packages/metrics")
    (license license:bsd-3)))

(define-public erlang-mimerl
  (package
    (name "erlang-mimerl")
    (version "1.2.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "mimerl" version))
              (sha256
               (base32
                "08wkw73dy449n68ssrkz57gikfzqk3vfnf264s31jn5aa1b5hy7j"))))
    (build-system rebar-build-system)
    (synopsis "Library to handle mimetypes")
    (description "Library to handle mimetypes")
    (home-page "https://hex.pm/packages/mimerl")
    (license license:expat)))

(define-public erlang-unicode-util-compat
  (package
    (name "erlang-unicode-util-compat")
    (version "0.7.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "unicode_util_compat" version))
              (sha256
               (base32
                "08952lw8cjdw8w171lv8wqbrxc4rcmb3jhkrdb7n06gngpbfdvi5"))))
    (build-system rebar-build-system)
    (synopsis "unicode_util compatibility library for Erlang < 20")
    (description "unicode_util compatibility library for Erlang < 20")
    (home-page "https://hex.pm/packages/unicode_util_compat")
    (license license:asl2.0)))

(define-public erlang-hackney
  (package
    (name "erlang-hackney")
    (version "1.18.1")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "hackney" version))
              (sha256
               (base32
                "13hja14kig5jnzcizpdghj68i88f0yd9wjdfjic9nzi98kzxmv54"))))
    (build-system rebar-build-system)
    (arguments
     ;; ===> Could not write to "/homeless-shelter/.cache/rebar3/hex". Please
     ;; ensure the path is writeable.
     (list #:tests? #f))
    (inputs
     (list erlang-certifi
           erlang-metrics
           erlang-mimerl
           erlang-parse-trans
           erlang-ssl-verify-fun
           erlang-unicode-util-compat
           rus:erlang-idna))
    (synopsis "Simple HTTP client")
    (description
     "This package provides a simple HTTP client for Erlang.")
    (home-page "https://hexdocs.pm/hackney")
    (license license:asl2.0)))

(define-public erlang-nitro
  (package
    (name "erlang-nitro")
    (version "7.6.1")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "nitro" version))
              (sha256
               (base32
                "1w41i7rq39sqz9kqxsmdr7s15iiifi5rwg40an80fyqzxqkfvsnv"))))
    (build-system rebar-build-system)
    (synopsis "NITRO Nitrogen Web Framework")
    (description "NITRO Nitrogen Web Framework")
    (home-page "https://hexdocs.pm/nitro/")
    (license license:isc)))

(define-public erlang-mochiweb
  (package
    (name "erlang-mochiweb")
    (version "3.0.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "mochiweb" version))
              (sha256
               (base32
                "1qxzybpyhg0mxy9szhgfcgnglx3hh1v6xdqqpcr6ijwh1clhfvyc"))))
    (build-system rebar-build-system)
    (arguments
;; Failed: 8.  Skipped: 0.  Passed: 146.
      '(#:tests? #f))
    (synopsis "MochiMedia Web Server")
    (description "MochiMedia Web Server")
    (home-page "https://hexdocs.pm/mochiweb/")
    (license license:expat)))

(define-public erlang-ranch
  (package
    (name "erlang-ranch")
    (version "2.1.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "ranch" version))
              (sha256
               (base32
                "05k9wxwi8fw0izg5f41j98lpdg4xzlj91i8ziq6jfxb15bxf6ki4"))))
    (build-system rebar-build-system)
    (synopsis "Socket acceptor pool for TCP protocols.")
    (description "Socket acceptor pool for TCP protocols.")
    (home-page "https://hex.pm/packages/ranch")
    (license license:isc)))

(define-public erlang-cowboy
  (package
    (name "erlang-cowboy")
    (version "2.9.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "cowboy" version))
              (sha256
               (base32
                "1phv0a1zbgk7imfgcm0dlacm7hbjcdygb0pqmx4s26jf9f9rywic"))))
    (build-system rebar-build-system)
    (inputs (list erlang-cowlib erlang-ranch))
    (synopsis "Small, fast, modern HTTP server.")
    (description "Small, fast, modern HTTP server.")
    (home-page "https://hex.pm/packages/cowboy")
    (license license:isc)))

(define-public erlang-katana-code
  (package
    (name "erlang-katana-code")
    (version "2.0.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "katana_code" version))
              (sha256
               (base32
                "1r5s00fx2v0ih4c6h89vfik09q90hxmx5zzm5fjdl51ajhpvpwyj"))))
    (build-system rebar-build-system)
    (synopsis "Functions useful for processing Erlang code.")
    (description
     "This package provides functions useful for processing Erlang code.")
    (home-page "https://hexdocs.pm/katana_code/")
    (license license:asl2.0)))

(define-public erlang-jsx
  (package
    (name "erlang-jsx")
    (version "3.1.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "jsx" version))
              (sha256
               (base32
                "1wr7jkxm6nlgvd52xhniav64xr9rml2ngb35rwjwqlqvq7ywhp0c"))))
    (build-system rebar-build-system)
    (arguments
      '(#:tests? #f)) ; one test is failing
    (synopsis "a streaming, evented json parsing toolkit")
    (description "a streaming, evented json parsing toolkit")
    (home-page "https://hexdocs.pm/jsx/")
    (license license:expat)))

(define-public erlang-quickrand
  (package
    (name "erlang-quickrand")
    (version "2.0.4")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "quickrand" version))
              (sha256
               (base32
                "0008m699n9vigyhc3m9izvk79wf738fiavnwx1af0a6g0j9qxcac"))))
    (build-system rebar-build-system)
    (synopsis
     "Quick Random Number Generation: Provides a simple interface to call efficient random number generation functions based on the context.  Proper random number seeding is enforced.")
    (description
     "Quick Random Number Generation: Provides a simple interface to call efficient
random number generation functions based on the context.  Proper random number
seeding is enforced.")
    (home-page "https://hex.pm/packages/quickrand")
    (license license:expat)))

(define-public erlang-uuid-erl
  (package
    (name "erlang-uuid-erl")
    (version "2.0.4")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "uuid_erl" version))
              (sha256
               (base32
                "1r2jcr5a2lad2sm7qggmnxa3gjwvryy05a1z72s8i6qx2lfcsk3s"))))
    (build-system rebar-build-system)
    (inputs (list erlang-quickrand))
    (synopsis "Erlang UUID Implementation")
    (description "Erlang UUID Implementation")
    (home-page "https://hex.pm/packages/uuid_erl")
    (license license:expat)))

(define-public erlang-ssl-verify-fun
  (package
    (name "erlang-ssl-verify-fun")
    (version "1.1.6")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "ssl_verify_fun" version))
              (sha256
               (base32
                "1026l1z1jh25z8bfrhaw0ryk5gprhrpnirq877zqhg253x3x5c5x"))))
    (build-system rebar-build-system)
    (synopsis "SSL verification functions for Erlang")
    (description "SSL verification functions for Erlang")
    (home-page "https://hex.pm/packages/ssl_verify_fun")
    (license license:expat)))

(define-public erlang-gpb
  (package
    (name "erlang-gpb")
    (version "4.19.5")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "gpb" version))
              (sha256
               (base32
                "13kgh1ijbh458llaawmnv5hh33pg73xrhhmi1kj9qibbsr86gdr1"))))
    (build-system rebar-build-system)
    (synopsis
     "A compiler for Google protocol buffer definitions files for Erlang.")
    (description
     "This package provides a compiler for Google protocol buffer definitions files
for Erlang.")
    (home-page "https://hexdocs.pm/gpb/")
    (license license:lgpl2.1)))

(define-public erlang-zlist
  (package
    (name "erlang-zlist")
    (version "1.2.1")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "zlist" version))
              (sha256
               (base32
                "08m6w775q9vs26v0qnqxjpma4g67bbhxgj8hmfa3ydsh4wm1dc9w"))))
    (build-system rebar-build-system)
    (synopsis "Erlang lazy list library")
    (description "Erlang lazy list library")
    (home-page "https://hex.pm/packages/zlist")
    (license license:expat)))

(define-public erlang-jsn
  (package
    (name "erlang-jsn")
    (version "2.2.2")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "jsn" version))
              (sha256
               (base32
                "16lg9r7jfyszcnc9ydgwrwf7nkbxb6g1m3h7gbw98ikrjy3f6slw"))))
    (build-system rebar-build-system)
    (synopsis "Utilities for interacting with decoded JSON in erlang")
    (description "Utilities for interacting with decoded JSON in erlang")
    (home-page "https://hexdocs.pm/jsn/")
    (license license:asl2.0)))

(define-public erlang-astranaut
  (package
    (name "erlang-astranaut")
    (version "0.10.1")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "astranaut" version))
              (sha256
               (base32
                "1zzwjf1h0ab7c5pr2x0a0bwdgjsbrqadjzva5jvymxbacvsp4m2i"))))
    (build-system rebar-build-system)
    (synopsis "Erlang Ast traverse and macro.")
    (description "Erlang Ast traverse and macro.")
    (home-page "https://hexdocs.pm/astranaut/")
    (license license:expat)))

(define-public erlang-erl-cbor
  (package
    (name "erlang-erl-cbor")
    (version "2.0.1")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "erl_cbor" version))
              (sha256
               (base32
                "1jial0r7bdg5yhsk370kdjr3k9wfdc9pwzzkhhcgs216hrgdgcs2"))))
    (build-system rebar-build-system)
    (synopsis "An Erlang implementation of the CBOR data encoding format.")
    (description "An Erlang implementation of the CBOR data encoding format.")
    (home-page "https://hexdocs.pm/erl_cbor/")
    (license license:isc)))

(define-public erlang-tomerl
  (package
    (name "erlang-tomerl")
    (version "0.5.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "tomerl" version))
              (sha256
               (base32
                "1ykrd5bknz3yclwcbzl6gi1mp01bphw5c99r3db7a3mzkqpvczra"))))
    (build-system rebar-build-system)
    (arguments
      '(#:tests? #f)) ; no tests
    (synopsis "Erlang TOML Parser")
    (description "Erlang TOML Parser")
    (home-page "https://hexdocs.pm/tomerl/")
    (license license:bsd-3)))

(define-public erlang-trie
  (package
    (name "erlang-trie")
    (version "2.0.4")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "trie" version))
              (sha256
               (base32
                "1h9c2jlazzld2znz96x0ivfqmg9f58nihnkqz1lrc01avbj9wpq3"))))
    (build-system rebar-build-system)
    (arguments
      '(#:tests? #f)) ; no tests
    (synopsis "Erlang Trie Implementation")
    (description "Erlang Trie Implementation")
    (home-page "https://hex.pm/packages/trie")
    (license license:expat)))

(define-public erlang-eini
  (package
    (name "erlang-eini")
    (version "1.2.9")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "eini" version))
              (sha256
               (base32
                "1jyzfgv40998pzz4kzw75d0n9qwv7p6l9pqcybk05xf2ny6swr6s"))))
    (build-system rebar-build-system)
    (arguments
      '(#:tests? #f)) ; no tests
    (synopsis "An Erlang INI parser")
    (description "An Erlang INI parser")
    (home-page "https://hex.pm/packages/eini")
    (license license:asl2.0)))

(define-public erlang-bear
  (package
    (name "erlang-bear")
    (version "1.0.0")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "bear" version))
              (sha256
               (base32
                "1nsri73b50n5v1a8252mm8car84j2b53bq7alq6zz16z3a86fyqm"))))
    (build-system rebar-build-system)
    (arguments
      '(#:tests? #f)) ; no tests
    (synopsis "A set of statistics functions for erlang")
    (description
     "This package provides a set of statistics functions for erlang")
    (home-page "https://hex.pm/packages/bear")
    (license license:asl2.0)))

(define-public erlang-supervisor3
  (package
    (name "erlang-supervisor3")
    (version "1.1.11")
    (source (origin
              (method url-fetch)
              (uri (hexpm-uri "supervisor3" version))
              (sha256
               (base32
                "0l2b21ka5wgh5sr949i5sf08n82yvc9cm2i1bacj9fmwrbdxxhp6"))))
    (build-system rebar-build-system)
    (synopsis
     "A copy of supervisor.erl from the R16B Erlang/OTP with modifications")
    (description
     "This package provides a copy of supervisor.erl from the R16B Erlang/OTP with
modifications")
    (home-page "https://hexdocs.pm/supervisor3/")
    (license license:mpl2.0)))
